<?php 
namespace Home\Widget;

use Think\Controller;

class ServiceItemWidget extends Controller {
	public function items($beautyId, $beauticianId) {
		
		$ServiceItemModel = D('ServiceItem');
		$list = $ServiceItemModel->getServiceList();
		
		if ($list) {
			foreach ($list as &$value) {
				$value ['purchases_total'] = $ServiceItemModel->getServicePurchasesTotal($value ['id']);
			}
		}
		
		$this->assign('list', $list);
		$this->assign('beauty_id', $beautyId);
		$this->assign('beautician_id', $beauticianId);
		$this->display('Widget/serviceItem');
	}
}
?>